package fatworm.parser.syntree;
import fatworm.concept.DataField;
/**
 *  syntax tree node 
 *	create a table
 */
public class CreateTableNode extends QueryNode{
	public String tableName = null;
	public String primaryKey = null;
	public java.util.ArrayList<DataField> columns = new java.util.ArrayList<DataField>();
	public String toString() {
		String ans = "CREATE TABLE " + tableName+"["+ primaryKey+"](";
		for( java.util.Iterator<DataField> i = columns.iterator() ; i.hasNext();){
			ans += i.next();
			if( i.hasNext() ) ans += ",";
		}
		ans += ")";
		return ans;
	}
	public void accept(IQueryVisitor visitor) {
		visitor.visit( this );	
	}
}	
